package airacrobats.control;

import airacrobats.game.object.Airplane;
import airacrobats.io.data.MovementData;
import java.util.List;

/**
 * This is the automatic controller. Here, the movements are made automatic.
 */
public class AutomaticController extends Controller
{   
    /**
     * @param airplane The airplane.
     * @param movements The movements of the route.
     */
    public AutomaticController(Airplane airplane, List<MovementData> movements)
    {
        super(airplane, movements);
    }

    /**
     */
    @Override
    public int update(long time, long deltaTime)
    {
        int score = super.update(time, deltaTime);

        if (currentMovement != null)
        {
            airplane.setRotation(currentMovement.getRoll(),
                    currentMovement.getPitch());
            
            airplane.setEnginePower(currentMovement.getEnginePowerGain());

            airplane.setSmokeOn(currentMovement.isSmokeOn());
        }
        
        return score;
    }

    /**
     */
    @Override
    protected int doUpdate(long deltaTime)
    {
        return 0;
    }
}
